﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 观测者模式_解耦实践2
{
    class Program
    {
        static void Main(string[] args)
        {
            Boss huhansan = new Boss();
            Observer tongshi1 = new StockObserver("张3", huhansan);
            Observer tongshi2 = new NBAObserver("李4", huhansan);

            huhansan.Append(tongshi1);
            huhansan.Append(tongshi2);

            huhansan.Detach(tongshi1);

            huhansan.Subjectstate = "我胡汉三回来了！";
            huhansan.Notify();
        }
    }
}
